package com.aruba.daggerapplication

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import com.aruba.daggerapplication.di.DaggerApplicationComponent
import com.aruba.daggerapplication.di.singleton.SingletonTest
import javax.inject.Inject
import javax.inject.Singleton

class ScopeActivity : AppCompatActivity() {

    @Inject
    lateinit var singleton1: SingletonTest

    @Inject
    lateinit var singleton2: SingletonTest

    override fun onCreate(savedInstanceState: Bundle?) {
        DaggerApplicationComponent.create().inject(this)
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_scope)

        Log.i("aruba_log", "singleton1 hashcode: ${singleton1.hashCode()}")
        Log.i("aruba_log", "singleton2 hashcode: ${singleton2.hashCode()}")
    }
}